<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>promise链式调用</title>
</head>
<body>

</body>
<script>
    let api = new Promise((resolve, reject) => {
        setTimeout(() => {
            if (true) {
                resolve(100000)
            } else {
                reject()
            }
        }, 1000)
    })
    api.then((res) => {
        console.log("今年的奖金", res);
        return res + 10000
    })
    .then((res) => {
        console.log('明年的奖金', res);
    })
    .catch(() => {})
</script>
</html>